//
//  SQLite3Connector.h
//  SQLite3Connector
//
//  Created by Ondrej Rafaj on 26.10.09.
//  Copyright 2009 Home. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "/usr/include/sqlite3.h"


@interface SQLite3Connector : NSObject {
	
	sqlite3 *database;
	
}

+ (NSString *) escapeString:(NSString *)string;

- (NSMutableArray *) getData:(NSString *)query fromDatabase:(NSString *)databaseName;

- (BOOL) executeQuery:(NSString *)query inDatabase:(NSString *)databaseName;

- (int) executeScalar:(NSString *)query inDatabase:(NSString *)databaseName;

+ (NSString *) getDocumentsDirectoryPath;

+ (NSString *) getDatabaseFolderPath;

+ (NSString *) getDatabasePathFromName:(NSString *)databaseName;

+ (BOOL) dropDatabase:(NSString *)databaseName;

+ (BOOL) databaseExists:(NSString *)databaseName;

+ (NSArray *) getDatabaseFilePaths:(NSString *)path;

+ (int) getDatabaseFileSize:(NSString *)path;

+ (NSString *) getDatabaseFormatedFileSize:(NSString *)databaseName;

- (BOOL) tableExists:(NSString *)tableName inDatabase:(NSString *)databaseName;

- (BOOL) truncateTable:(NSString *)tableName inDatabase:(NSString *)databaseName;

- (BOOL) truncateTable:(NSString *)tableName inDatabase:(NSString *)databaseName useVacuum:(BOOL)use;

- (BOOL) dropTable:(NSString *)tableName inDatabase:(NSString *)databaseName;

- (BOOL) dropTable:(NSString *)tableName inDatabase:(NSString *)databaseName useVacuum:(BOOL)use;

- (NSMutableArray *) getTablesInDatabase:(NSString *)databaseName;

@end
